<template>
  <Header />
  <router-view v-slot="{ Component, route }">
    <!-- 缓存的页面 -->
    <keep-alive>
      <component
          :is="Component"
          v-if="route.meta.keepAlive"
          :key="route.fullPath"
      />
    </keep-alive>

    <!-- 不缓存的页面 -->
    <component
        :is="Component"
        v-if="!route.meta.keepAlive"
        :key="route.fullPath"
    />
  </router-view>
  <Footer />
</template>

<script setup>
import Header from '@/components/Header.vue'
import Footer from '@/components/Footer.vue'
</script>

<style>
body {
  margin: 0;
  padding: 0;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #333;
  line-height: 1.5;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* 响应式设计 */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    padding: 10px;
  }

  .logo {
    margin-bottom: 10px;
  }

  .el-menu-demo {
    width: 100%;
  }

  .search-box {
    width: 100%;
    margin: 10px 0;
  }

  .banner-content {
    left: 20px;
    bottom: 50px;
  }

  .banner-content h2 {
    font-size: 24px;
  }

  .banner-content p {
    font-size: 14px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .social-links {
    margin-top: 15px;
  }
}
</style>
